Builder

class Builder

A builder of Cookie.

Builders are created by invoking newBuilder. Each of the setter methods modifies the state of the builder and returns the same instance. Builders are not thread-safe and should not be used concurrently from multiple threads without external synchronization.

Functions

Link copied to clipboard
open fun build(): Cookie
Returns a new Cookie built from the current state of this builder.
Link copied to clipboard
open fun creationTime(creationTime: Timestamp): Cookie.Builder
Sets the cookie creation time.
Link copied to clipboard
open fun expirationTime(expirationTime: Timestamp): Cookie.Builder
Sets the cookie expiration time.
Link copied to clipboard
open fun httpOnly(httpOnly: Boolean): Cookie.Builder
Specifies whether the cookie is considered HTTP only.
Link copied to clipboard
open fun name(name: String): Cookie.Builder
Sets the cookie name.
Link copied to clipboard
open fun path(path: String): Cookie.Builder
Sets the cookie path.
Link copied to clipboard
open fun sameSite(sameSite: SameSite): Cookie.Builder
Sets the SameSite cookie attribute value that allows you to declare if your cookie should be restricted to a first-party or same-site context.
Link copied to clipboard
open fun secure(secure: Boolean): Cookie.Builder
Specifies whether the cookie is restricted to a secure protocol (HTTPS or WSS) or it can be sent using any protocol.
Link copied to clipboard
open fun value(value: String): Cookie.Builder
Sets the cookie value.